import { promises as fs } from 'fs'; // 使用 promises API
import path from 'path'; // 导入 path 模块

// 声明文件路径
const autoImportsPath = path.join(process.cwd(), 'src/types/auto-imports.d.ts');
const componentsPath = path.join(process.cwd(), 'src/types/components.d.ts');

// 删除声明文件的函数
async function deleteFiles() {
    try {
        await fs.unlink(autoImportsPath);
        console.log('Deleted auto-imports.d.ts');
    } catch (err) {
        console.error('Could not delete auto-imports.d.ts:', err.message);
    }

    try {
        await fs.unlink(componentsPath);
        console.log('Deleted components.d.ts');
    } catch (err) {
        console.error('Could not delete components.d.ts:', err.message);
    }
}

// 执行删除操作
deleteFiles();
